package com.yoshino.prototype.improve;

import lombok.Data;

/**
 * @author yoshino
 **/
@Data
public class Sheep implements Cloneable{

    private String name;
    private int age;
    private String color;
    private String address = "china";
    // 另一个对象

    private Sheep friend;

    public Sheep(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    @Override
    public String toString() {
        return "Sheep{" + "name='" + name + '\'' + ", age=" + age + ", color='" + color + '\'' + ", address='" + address + '\'' + '}';
    }

    /**
     * 克隆该实例，使用默认的 clone 方法来完成
     * @return
     * @throws CloneNotSupportedException
     */
    @Override
    protected Object clone() throws CloneNotSupportedException {
        Sheep sheep = null;
        sheep = (Sheep) super.clone();
        return sheep;
    }
}
